﻿<TabItem x:Class="DarklandsSaveGameEditor.Views.CharacterTab"
         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
         xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
         xmlns:views="clr-namespace:DarklandsUiCommon.Views.Character;assembly=DarklandsUiCommon"
         mc:Ignorable="d"
         d:DesignHeight="300" d:DesignWidth="300"

         Header="{Binding Character.ShortName, FallbackValue=None}">

    <AdornerDecorator>

        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>

            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>

            <!-- UseLayoutRounding should help with rotated text blurriness -->
            <TabControl TabStripPlacement="Left" UseLayoutRounding="True">

                <TabControl.Resources>
                    <Style TargetType="{x:Type TabItem}">
                        <Setter Property="HeaderTemplate">
                            <Setter.Value>
                                <DataTemplate>
                                    <ContentPresenter Content="{TemplateBinding Content}">
                                        <ContentPresenter.LayoutTransform>
                                            <RotateTransform Angle="-90" />
                                        </ContentPresenter.LayoutTransform>
                                    </ContentPresenter>
                                </DataTemplate>
                            </Setter.Value>
                        </Setter>
                        <Setter Property="Padding" Value="2,6" />
                    </Style>
                </TabControl.Resources>

                <TabItem Header="Details">
                    <AdornerDecorator>
                        <views:CharacterDetailsView DataContext="{Binding DetailsVm}" />
                    </AdornerDecorator>
                </TabItem>

                <TabItem Header="Stats">
                    <AdornerDecorator>
                        <views:StatView DataContext="{Binding StatVm}" />
                    </AdornerDecorator>
                </TabItem>

                <TabItem Header="Saints">
                    <AdornerDecorator>
                        <views:SaintView DataContext="{Binding SaintVm}" />
                    </AdornerDecorator>
                </TabItem>

                <TabItem Header="Alchemy">
                    <AdornerDecorator>
                        <views:FormulaeView DataContext="{Binding FormulaeVm}" />
                    </AdornerDecorator>
                </TabItem>

                <TabItem Header="Equipment">
                    <AdornerDecorator>
                        <views:EquipmentListView DataContext="{Binding EquipmentListVm}" />
                    </AdornerDecorator>
                </TabItem>
            </TabControl>

        </Grid>

    </AdornerDecorator>
</TabItem>